package file;

import java.io.File;

public class Demo2 {
    public static void main(String[] args) {
        for (int i = 100; i >= 0 ; i--) {
            File file = new File("./test"+i+".txt");
            if (file.exists()){
                file.delete();
                System.out.println("文件已删除");
            }else {
                System.out.println("该文件不存在!");
            }
        }
        System.out.println("删除完毕");
    }

}
